package cn.oa.dao;


import cn.oa.entity.Employee;
import cn.oa.util.SessionFatoryUtil;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.jupiter.api.Test;

public class EmployeeDaoTest {

    @Test
    public void findEmployee() throws Exception{
        SqlSessionFactory factory = SessionFatoryUtil.sessionFactory;
        SqlSession sqlSession = factory.openSession();
        try{
            Employee employee = sqlSession.getMapper(EmployeeDao.class).findEmployee("1000890902","234567");
            System.out.printf(employee.getEmail());
        }finally {
            sqlSession.close();
        }
    }
}